{{include file="header.tpl"}}
<div class="w1002">
    <div class="Fl">
    <h2>相关信息</h2>
    <ul>
        <li>帮助中心</li>
        <li></li>
    </ul>
    </div>
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="table_list">
    {{foreach from=$res.data item=item}}
    <tr>
        <td class="lf"><a href="index.php?ctl=article&act=show&id={{$item.ID}}">{{$item.TITLE}}</td>
        <td>{{$item.CREATE_TIME|date_format:"%Y-%m-%d" }}</td>
    </tr>
    {{/foreach}}
        <tr class="bottom"><td colspan="10" class="page">{{$res.page}}</td></tr>
        <tr><td colspan="10">没有数据记录</td></tr>
</table>
    {{if $smarty.request.id==15}}
    
    <form action="index.php?ctl=article&act=QueSave" method="post" id="queform" name="queform">
        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="table_list">
            <tr><td colspan="10">标题：<input type="text" name="title" id="title"></td></tr>
             <tr><td colspan="10">内容：<textarea name="content" cols="80" rows="8" id="content"></textarea></td></tr>
             {{if $user.USERNAME}}
             <input type="hidden" name="user_id" value="{{$user.ID}}">
             <input type="hidden" name="catid" value="{{$smarty.request.id}}">
              <tr><td colspan="10"><input type="button" name="submit" id="subloan" value="提交"></td></tr>
             {{else}}
             <tr><td colspan="10">请先登录</td></tr>  
             {{/if}}
        </table>   
    </form>
    {{/if}}
</div>
{{include file="footer.tpl"}}
<script type="text/javascript">
      $('#subloan').click(function(){
            if($('#title').val()!="" && $('#content').val()!=""){
                var param = $('#queform').serialize();
//                $.jBox.tip('正在申请...','loading');
                $.post("index.php?ctl=article&act=QueSave",param,function(res){
                    var submit =function(v,g,f){
                    if(v == "ok")
                         window.open(res.tourl,"_top");                         
                    }
                    if(res.code == 'success'){
                        $.jBox.confirm("提交问题成功。","提示",submit);
                       
                    }else{
                        $.jBox.confirm(res.msg,"提示",submit);
                    }
                },"json");          
            }else if($('#title').val()==""){
                $.jBox.alert('请填写标题','提示');
            }
            else if($('#content').val()==""){
                $.jBox.alert('请填写内容','提示');
            }
            return false;
            
        });
</script>